<div class="layui-form" lay-filter="layuiadmin-form-equipment" style="padding: 20px 30px 0 0;">
    <div class="layui-form-item">
        <label class="layui-form-label">设备名称</label>
        <div class="layui-input-inline">
            <script type="text/html" template>
                <input type="text" name="name" value="{{ d.params.name || '' }}" lay-verify="required" placeholder="请输入设备名称" autocomplete="off" class="layui-input">
            </script>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">制造商</label>
        <div class="layui-input-inline">
            <script type="text/html" template>
                <input type="text" name="producer" value="{{ d.params.producer || '' }}" lay-verify="required" placeholder="请输入设备制造商" autocomplete="off" class="layui-input">
            </script>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">设备类型</label>
        <div class="layui-input-inline">
            <script type="text/html" template>
                <select name="type" lay-verify="required">
                  <option value="" {{ d.params.type === '' ? 'selected' : '' }}>请选择设备类型</option>
                  <option value="1" {{ d.params.type === '1' ? 'selected' : '' }}>PC</option>
                  <option value="2" {{ d.params.type === '2' ? 'selected' : '' }}>显示器</option>
                  <option value="3" {{ d.params.type === '3' ? 'selected' : '' }}>电源</option>
                </select>
            </script>
        </div>
    </div>
    <!-- <div class="layui-form-item"> -->
    <label class="layui-form-label">设备细节</label>
    <div class="layui-card-body">
        <!-- <script type="text/html" template> -->
        <div style="padding-bottom: 10px;">
            <button type="button" class="layui-btn layuiadmin-btn-admin" onclick="adddetails()">+</button>
        </div>
        <table id="LAY-details-back-manage" lay-filter="LAY-details-back-manage"></table>
        <!-- </script> -->
    </div>
    <!-- </div> -->
    <div class="layui-form-item">
        <label class="layui-form-label">设备描述</label>
        <div class="layui-input-block">
            <script type="text/html" template>
                <textarea name="describe" placeholder="请输入设备描述" class="layui-textarea">{{ d.params.describe || '' }}</textarea>
            </script>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label"></label>
        <div class="layui-input-inline">
            <input type="button" lay-submit lay-filter="LAY-user-back-submit" value="确认" class="layui-btn">
        </div>
    </div>
</div>
<script>
    function adddetails() {
        layui.use('table', function() {
            var table = layui.table;
            var oldData = table.cache["LAY-details-back-manage"];
            var data = {
                "key": "",
                "value": ""
            };
            oldData.push(data);
            table.reload('LAY-details-back-manage', {
                data: oldData
            });
        });
    }

    layui.use('table', function() {
        var table = layui.table;

        table.render({
            elem: '#LAY-details-back-manage',
            cols: [
                [{
                    field: 'key',
                    title: '项',
                    edit: 'text'
                }, {
                    field: 'value',
                    title: '内容',
                    edit: 'text'
                }, ]
            ],
            text: {
                none: '暂无相关数据'
            },
            data: [],
            page: false
        });
    })
</script>